package com.jprocms.module.cms.controller.admin.channel.vo;

import com.jprocms.module.cms.enums.EnumRecycle;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Schema(description = "栏目查询Request Request VO")
@Data
public class ChannelListReqVO {


    @Schema(description = "站点ID")
    private Long siteId;

    @Schema(description = "父栏目ID")
    private Long parentId;

    @Schema(description = "是否包含子栏目")
    private Boolean includeChild;

    @Schema(description = "栏目名称")
    private String name;

    @Schema(description = "访问路径")
    private String path;

    @Schema(description = "层级目录（父ID_ID拼接）")
    private String nodePath;

    @Schema(description = "工作流ID")
    private Long workflowId;

    @Schema(description = "列表是否显示")
    private Integer listStatus;

    @Schema(description = "是否加入回收站（0-未加入  1-已加入）")
    private Integer recycleStatus;

    /**
     * 是否允许投稿（0-不允许  1-允许）
     */
    private Integer contributeStatus;
    /**
     * 是否开启索引查询
     */
    private Integer searchStatus;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "key 匹配栏目名称或者路径或者ID")
    private String key;

    public ChannelListReqVO(Long siteId, Long parentId, Boolean includeChild, Integer listStatus, Integer recycleStatus) {
        this.siteId = siteId;
        this.parentId = parentId;
        this.includeChild = includeChild;
        this.listStatus = listStatus;
        this.recycleStatus = recycleStatus;
    }

    public static ChannelListReqVO of(Long siteId, Long parentId, Boolean includeChild, Integer listStatus) {
        return new ChannelListReqVO(siteId, parentId, includeChild, listStatus, EnumRecycle.NO_RECYCLE.getStatus());
    }

}
